<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="UTF-8">
		<title>物流信息生成</title>
		<link rel="stylesheet" type="text/css" th:href="@{/css/cart.css}" />
		<link rel="stylesheet" type="text/css" th:href="@{/dist/css/bootstrap.min.css}">
		<link rel="stylesheet" type="text/css" th:href="@{/css/index.css}"/>
		<link rel="stylesheet" type="text/css" th:href="@{/css/animate.css}"/>
		<link rel="stylesheet" th:href="@{/layui/css/layui.css}">

	</head>

	<body>
	<!--导航部分  begin-->
	<div th:replace="admin/common/header :: nav"></div>
	<!--导航部分 end-->

	<div class="container">
		<!--左边-->
		<div class="col-md-8 col-sm-12" style="width:100%">
			<!--左边-->
			<ol class="breadcrumb">
				<li>
					<a href="#" class="text-success"><span class="glyphicon glyphicon-heart"></span>&nbsp;&nbsp;物流信息生成</a>
				</li>
			</ol>

			<!--购物车表格 begin-->
			<div class="table-responsive" id="imgDiv">
				<form class="layui-form" method="post" th:action="@{/admin/addExpress}" required  lay-verify="required" enctype="multipart/form-data">

					<div class="layui-form-item">
						<label class="layui-form-label">订单编号</label>
						<div class="layui-input-block">
							<input type="text" name="orderNum" id="orderNum" readonly th:value="${order.orderNum}" required  lay-verify="required" autocomplete="off" class="layui-input">
						</div>
					</div>

					<div class="layui-form-item">
						<label class="layui-form-label">快递单号</label>
						<div class="layui-input-block">
							<input type="text" name="expNum" id="expNum" readonly required  lay-verify="required" autocomplete="off" class="layui-input">
							<input type="button" class="btn btn-info" onclick="generateExpNum()" value="生成快递单号">
						</div>
					</div>

					<div class="layui-form-item">
						<label class="layui-form-label">快递公司</label>
						<div class="layui-input-block">
							<input type="radio" name="expCompany" value="顺丰" title="顺丰" checked>
							<input type="radio" name="expCompany" value="中通" title="中通">
							<input type="radio" name="expCompany" value="韵达" title="韵达" >
						</div>
					</div>

					<div class="layui-form-item">
						<label class="layui-form-label">快递员</label>
						<div class="layui-input-block">
							<input type="text" name="courier"    placeholder="请输入快递员姓名" required  lay-verify="required" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">快递员电话</label>
						<div class="layui-input-block">
							<input type="text" name="courierPhone" onblur="checkPhone(this)" id="phone"  placeholder="请输入快递员电话" required  lay-verify="required" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block">
							<!-- <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button> -->
							<input type="submit" class="layui-btn" lay-submit value="提交">
							<button type="reset" class="layui-btn layui-btn-primary">重置</button>
						</div>
					</div>
				</form>
			</div>
			<!--购物车 end-->
		</div>
	</div>


		<!--首页底部信息 begin-->
		<div class="container">

		<div th:replace="common/footer :: footer"></div>
		</div>
		<!--end-->

		<!--引入js文件-->
		<script src="js/details.js" th:src="@{/js/details.js}" type="text/javascript" charset="utf-8"></script>
		<script src="js/cart.js" th:src="@{/js/cart.js}" type="text/javascript" charset="utf-8"></script>
		<script src="dist/js/jquery.min.js" th:src="@{/dist/js/jquery.min.js}"></script>
		<script src="js/carousel.js" th:src="@{/js/carousel.js}" type="text/javascript" charset="utf-8"></script>
		<script src="dist/js/bootstrap.min.js" th:src="@{/dist/js/bootstrap.min.js}"></script>
		<script src="js/wow.js" th:src="@{/js/wow.js}"></script>
		<script th:src="@{/layui/layui.js}"></script>
		<script th:inline="javascript">
			//获取应用路径
			var contextPath = [[${#request.getContextPath()}]];
			var admin = [[${session.admin}]]

		</script>
	<script>
		layui.use('laydate', function(){
			var laydate = layui.laydate;

			//执行一个laydate实例
			laydate.render({
				elem: '#test1', //指定元素
				type: 'datetime'
			});
		});
	</script>
		<script type="text/javascript">
			if(!(/msie [6|7|8|9]/i.test(navigator.userAgent))) {
				new WOW().init();
			};

			$(function () {
				if (admin == null || admin == undefined || admin == 'undefined') {
					location.href = contextPath + "/book/index";
				}
			})

			//生成快递单号：时间精确至毫秒
			function generateExpNum() {
				var d = new Date();
				document.getElementById("expNum").value = d.getFullYear().toString()+d.getMonth().toString()
						+d.getDay().toString()+d.getHours().toString()+d.getMinutes().toString()+d.getSeconds().toString()+d.getMilliseconds().toString();
			}

			//检查电话
			function checkPhone() {
				var phone = $("#phone").val();
				var telReg = new RegExp("((\\d{11})|^((\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1})|(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1}))$)");
				if (!telReg.test(phone)){
					layer.msg('电话号码不合法！', {icon: 7,anim:6});
					return;
				}
			}
		</script>

	<style type="text/css">
		td {text-align: center}
		th {text-align: center}
	</style>
	</body>

</html>